﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;

namespace Core.Repositories
{
    /// <summary>
    /// Defines interface for common data access functionality for entity.
    /// </summary>
    /// <typeparam name="EType">Type of entity</typeparam>
    public interface IRepository<T>
    { 
        IQueryable<T> GetAll();
        T GetOne(Expression<Func<T, bool>> filter);
        IQueryable<T> GetMany(Expression<Func<T, bool>> filter);
        bool Delete(T entity);
        bool Delete(Expression<Func<T, bool>> filter);
        T Create(T entity);
        bool Update(T entity);
    }
}
